home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / gd25s.zip / CONFIGUR < prev    next >
Text File  |  1993-10-08  |  41KB  |  1,458 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. > confdefs.h
  93. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  94.  
  95. # A filename unique to this package, relative to the directory that
  96. # configure is in, which we can look for to find out if srcdir is correct.
  97. unique_file=diff.h
  98.  
  99. # Find the source files, if location was not specified.
  100. if test -z "$srcdir"; then
  101.   srcdirdefaulted=yes
  102.   # Try the directory containing this script, then `..'.
  103.   prog=$0
  104.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  105.   test "X$confdir" = "X$prog" && confdir=.
  106.   srcdir=$confdir
  107.   if test ! -r $srcdir/$unique_file; then
  108.     srcdir=..
  109.   fi
  110. fi
  111. if test ! -r $srcdir/$unique_file; then
  112.   if test x$srcdirdefaulted = xyes; then
  113.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  114.   else
  115.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  116.   fi
  117.   exit 1
  118. fi
  119. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  120. # But we can't avoid them for `..', to make subdirectories work.
  121. case $srcdir in
  122.   .|/*|~*) ;;
  123.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  124. esac
  125.  
  126. # Check for an already configured srcdir.
  127. if test z"`sh -c pwd`" = z"`(cd $srcdir; sh -c pwd)`" && \
  128.    test -r $srcdir/config.status; then
  129.   cat <<EOF >&2
  130. configure: The directory tree \`${srcdir}' is being used
  131.    as a build directory right now; it has been configured in its own
  132.    right.  You cannot currently configure and build in both the source
  133.    directory and another build directory.  To configure in this directory,
  134.    you must first do \`make distclean' in ${srcdir},
  135.    and then run configure again.
  136. EOF
  137.   exit 1
  138. fi
  139.  
  140. # Save the original args to write them into config.status later.
  141. configure_args="$*"
  142.  
  143.  
  144. if test -z "$CC"; then
  145.   # Extract the first word of `gcc', so it can be a program name with args.
  146.   set dummy gcc; word=$2
  147.   echo checking for $word
  148.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  149.   for dir in $PATH; do
  150.     test -z "$dir" && dir=.
  151.     if test -f $dir/$word; then
  152.       CC="gcc"
  153.       break
  154.     fi
  155.   done
  156.   IFS="$saveifs"
  157. fi
  158. test -z "$CC" && CC="cc"
  159. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  160.  
  161. # Find out if we are using GNU C, under whatever name.
  162. cat > conftest.c <<EOF
  163. #ifdef __GNUC__
  164.   yes
  165. #endif
  166. EOF
  167. ${CC-cc} -E conftest.c > conftest.out 2>&1
  168. if egrep yes conftest.out >/dev/null 2>&1; then
  169.   GCC=1 # For later tests.
  170. fi
  171. rm -f conftest*
  172.  
  173. echo checking how to run the C preprocessor
  174. if test -z "$CPP"; then
  175.   # This must be in double quotes, not single quotes, because CPP may get
  176.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  177.   # make.  It must be expanded now.
  178.   CPP="${CC-cc} -E"
  179.   cat > conftest.c <<EOF
  180. #include "confdefs.h"
  181. #include <stdio.h>
  182. Syntax Error
  183. EOF
  184. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  185. if test -z "$err"; then
  186.   :
  187. else
  188.   CPP=/lib/cpp
  189. fi
  190. rm -f conftest*
  191. fi
  192. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  193.  
  194. # Make sure to not get the incompatible SysV /etc/install and
  195. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  196. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  197. # or the AFS install, which mishandles nonexistent args, or
  198. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  199. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  200. # anyway.  Sigh.
  201. if test "z${INSTALL}" = "z" ; then
  202.   echo checking for install
  203.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  204.   for dir in $PATH; do
  205.     test -z "$dir" && dir=.
  206.     case $dir in
  207.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  208.     *)
  209.       if test -f $dir/installbsd; then
  210.     INSTALL="$dir/installbsd -c" # OSF1
  211.     INSTALL_PROGRAM='$(INSTALL)'
  212.     INSTALL_DATA='$(INSTALL) -m 644'
  213.     break
  214.       fi
  215.       if test -f $dir/install; then
  216.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  217.       : # AIX
  218.     else
  219.       INSTALL="$dir/install -c"
  220.       INSTALL_PROGRAM='$(INSTALL)'
  221.       INSTALL_DATA='$(INSTALL) -m 644'
  222.       break
  223.     fi
  224.       fi
  225.       ;;
  226.     esac
  227.   done
  228.   IFS="$saveifs"
  229. fi
  230. INSTALL=${INSTALL-cp}
  231. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  232. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  233. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  234. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  235. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  236.  
  237. echo checking for minix/config.h
  238. cat > conftest.c <<EOF
  239. #include "confdefs.h"
  240. #include <minix/config.h>
  241. EOF
  242. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  243. if test -z "$err"; then
  244.   MINIX=1
  245. fi
  246. rm -f conftest*
  247.  
  248. # The Minix shell can't assign to the same variable on the same line!
  249. if test -n "$MINIX"; then
  250.   
  251. {
  252. test -n "$verbose" && \
  253. echo "    defining _POSIX_SOURCE"
  254. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  255. DEFS="$DEFS -D_POSIX_SOURCE=1"
  256. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  257. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  258. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  259. "
  260. }
  261.  
  262.   
  263. {
  264. test -n "$verbose" && \
  265. echo "    defining" _POSIX_1_SOURCE to be 2
  266. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  267. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  268. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  269. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  270. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  271. "
  272. }
  273.  
  274.   
  275. {
  276. test -n "$verbose" && \
  277. echo "    defining _MINIX"
  278. echo "#define" _MINIX 1 >> confdefs.h
  279. DEFS="$DEFS -D_MINIX=1"
  280. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  281. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  282. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  283. "
  284. }
  285.  
  286. fi
  287.  
  288. echo checking for POSIXized ISC
  289. if test -d /etc/conf/kconfig.d &&
  290.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  291. then
  292.   ISC=1 # If later tests want to check for ISC.
  293.   
  294. {
  295. test -n "$verbose" && \
  296. echo "    defining _POSIX_SOURCE"
  297. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  298. DEFS="$DEFS -D_POSIX_SOURCE=1"
  299. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  300. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  301. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  302. "
  303. }
  304.  
  305.   if test -n "$GCC"; then
  306.     CC="$CC -posix"
  307.   else
  308.     CC="$CC -Xp"
  309.   fi
  310. fi
  311.  
  312. echo checking for directory library header
  313. dirheader=
  314. if test -z "$dirheader"; then
  315.   echo checking for dirent.h
  316. cat > conftest.c <<EOF
  317. #include "confdefs.h"
  318. #include <sys/types.h>
  319. #include <dirent.h>
  320. int main() { exit(0); }
  321. int t() { DIR *dirp = opendir ("/"); }
  322. EOF
  323. if eval $compile; then
  324.   
  325. {
  326. test -n "$verbose" && \
  327. echo "    defining DIRENT"
  328. echo "#define" DIRENT 1 >> confdefs.h
  329. DEFS="$DEFS -DDIRENT=1"
  330. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  331. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  332. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  333. "
  334. }
  335.  dirheader=dirent.h
  336. fi
  337. rm -f conftest*
  338. fi
  339. if test -z "$dirheader"; then
  340.   echo checking for sys/ndir.h
  341. cat > conftest.c <<EOF
  342. #include "confdefs.h"
  343. #include <sys/types.h>
  344. #include <sys/ndir.h>
  345. int main() { exit(0); }
  346. int t() { DIR *dirp = opendir ("/"); }
  347. EOF
  348. if eval $compile; then
  349.   
  350. {
  351. test -n "$verbose" && \
  352. echo "    defining SYSNDIR"
  353. echo "#define" SYSNDIR 1 >> confdefs.h
  354. DEFS="$DEFS -DSYSNDIR=1"
  355. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  356. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  357. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  358. "
  359. }
  360.  dirheader=sys/ndir.h
  361. fi
  362. rm -f conftest*
  363. fi
  364. if test -z "$dirheader"; then
  365.   echo checking for sys/dir.h
  366. cat > conftest.c <<EOF
  367. #include "confdefs.h"
  368. #include <sys/types.h>
  369. #include <sys/dir.h>
  370. int main() { exit(0); }
  371. int t() { DIR *dirp = opendir ("/"); }
  372. EOF
  373. if eval $compile; then
  374.   
  375. {
  376. test -n "$verbose" && \
  377. echo "    defining SYSDIR"
  378. echo "#define" SYSDIR 1 >> confdefs.h
  379. DEFS="$DEFS -DSYSDIR=1"
  380. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  381. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  382. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  383. "
  384. }
  385.  dirheader=sys/dir.h
  386. fi
  387. rm -f conftest*
  388. fi
  389. if test -z "$dirheader"; then
  390.   echo checking for ndir.h
  391. cat > conftest.c <<EOF
  392. #include "confdefs.h"
  393. #include <sys/types.h>
  394. #include <ndir.h>
  395. int main() { exit(0); }
  396. int t() { DIR *dirp = opendir ("/"); }
  397. EOF
  398. if eval $compile; then
  399.   
  400. {
  401. test -n "$verbose" && \
  402. echo "    defining NDIR"
  403. echo "#define" NDIR 1 >> confdefs.h
  404. DEFS="$DEFS -DNDIR=1"
  405. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  406. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  407. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  408. "
  409. }
  410.  dirheader=ndir.h
  411. fi
  412. rm -f conftest*
  413. fi
  414.  
  415. echo checking for closedir return value
  416. cat > conftest.c <<EOF
  417. #include "confdefs.h"
  418. #include <sys/types.h>
  419. #include <$dirheader>
  420. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  421. EOF
  422. eval $compile
  423. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  424.   :
  425. else
  426.   
  427. {
  428. test -n "$verbose" && \
  429. echo "    defining VOID_CLOSEDIR"
  430. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  431. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  432. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  433. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  434. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  435. "
  436. }
  437.  
  438. fi
  439. rm -f conftest*
  440.  
  441. prog='/* Ultrix mips cc rejects this.  */
  442. typedef int charset[2]; const charset x;
  443. /* SunOS 4.1.1 cc rejects this.  */
  444. char const *const *ccp;
  445. char **p;
  446. /* AIX XL C 1.02.0.0 rejects this.
  447.    It does not let you subtract one const X* pointer from another in an arm
  448.    of an if-expression whose if-part is not a constant expression */
  449. const char *g = "string";
  450. ccp = &g + (g ? g-g : 0);
  451. /* HPUX 7.0 cc rejects these. */
  452. ++ccp;
  453. p = (char**) ccp;
  454. ccp = (char const *const *) p;
  455. { /* SCO 3.2v4 cc rejects this.  */
  456.   char *t;
  457.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  458.  
  459.   *t++ = 0;
  460. }
  461. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  462.   int x[] = {25,17};
  463.   const int *foo = &x[0];
  464.   ++foo;
  465. }
  466. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  467.   typedef const int *iptr;
  468.   iptr p = 0;
  469.   ++p;
  470. }
  471. { /* AIX XL C 1.02.0.0 rejects this saying
  472.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  473.   struct s { int j; const int *ap[3]; };
  474.   struct s *b; b->j = 5;
  475. }'
  476. echo checking for working const
  477. cat > conftest.c <<EOF
  478. #include "confdefs.h"
  479.  
  480. int main() { exit(0); }
  481. int t() { $prog }
  482. EOF
  483. if eval $compile; then
  484.   :
  485. else
  486.   
  487. {
  488. test -n "$verbose" && \
  489. echo "    defining" const to be empty
  490. echo "#define" const  >> confdefs.h
  491. DEFS="$DEFS -Dconst="
  492. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  493. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  494. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  495. "
  496. }
  497.  
  498. fi
  499. rm -f conftest*
  500.  
  501. echo checking for ANSI C header files
  502. cat > conftest.c <<EOF
  503. #include "confdefs.h"
  504. #include <stdlib.h>
  505. #include <stdarg.h>
  506. #include <string.h>
  507. #include <float.h>
  508. EOF
  509. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  510. if test -z "$err"; then
  511.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  512. echo '#include "confdefs.h"
  513. #include <string.h>' > conftest.c
  514. eval "$CPP conftest.c > conftest.out 2>&1"
  515. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  516.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  517. cat > conftest.c <<EOF
  518. #include "confdefs.h"
  519. #include <ctype.h>
  520. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  521. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  522. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  523. int main () { int i; for (i = 0; i < 256; i++)
  524. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  525. exit (0); }
  526.  
  527. EOF
  528. eval $compile
  529. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  530.   
  531. {
  532. test -n "$verbose" && \
  533. echo "    defining STDC_HEADERS"
  534. echo "#define" STDC_HEADERS 1 >> confdefs.h
  535. DEFS="$DEFS -DSTDC_HEADERS=1"
  536. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  537. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  538. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  539. "
  540. }
  541.  
  542. fi
  543. rm -f conftest*
  544. fi
  545. rm -f conftest*
  546.  
  547. fi
  548. rm -f conftest*
  549.  
  550. echo checking for unistd.h
  551. cat > conftest.c <<EOF
  552. #include "confdefs.h"
  553. #include <unistd.h>
  554. EOF
  555. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  556. if test -z "$err"; then
  557.   
  558. {
  559. test -n "$verbose" && \
  560. echo "    defining HAVE_UNISTD_H"
  561. echo "#define" HAVE_UNISTD_H 1 >> confdefs.h
  562. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  563. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
  564. \${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
  565. \${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
  566. "
  567. }
  568.  
  569. fi
  570. rm -f conftest*
  571.  
  572. echo checking for pid_t in sys/types.h
  573. echo '#include "confdefs.h"
  574. #include <sys/types.h>' > conftest.c
  575. eval "$CPP conftest.c > conftest.out 2>&1"
  576. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  577.   :
  578. else
  579.   
  580. {
  581. test -n "$verbose" && \
  582. echo "    defining" pid_t to be int
  583. echo "#define" pid_t int >> confdefs.h
  584. DEFS="$DEFS -Dpid_t=int"
  585. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  586. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  587. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  588. "
  589. }
  590.  
  591. fi
  592. rm -f conftest*
  593.  
  594. echo checking for return type of signal handlers
  595. cat > conftest.c <<EOF
  596. #include "confdefs.h"
  597. #include <sys/types.h>
  598. #include <signal.h>
  599. #ifdef signal
  600. #undef signal
  601. #endif
  602. extern void (*signal ()) ();
  603. int main() { exit(0); }
  604. int t() { int i; }
  605. EOF
  606. if eval $compile; then
  607.   
  608. {
  609. test -n "$verbose" && \
  610. echo "    defining" RETSIGTYPE to be void
  611. echo "#define" RETSIGTYPE void >> confdefs.h
  612. DEFS="$DEFS -DRETSIGTYPE=void"
  613. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  614. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  615. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  616. "
  617. }
  618.  
  619. else
  620.   
  621. {
  622. test -n "$verbose" && \
  623. echo "    defining" RETSIGTYPE to be int
  624. echo "#define" RETSIGTYPE int >> confdefs.h
  625. DEFS="$DEFS -DRETSIGTYPE=int"
  626. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  627. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  628. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  629. "
  630. }
  631.  
  632. fi
  633. rm -f conftest*
  634.  
  635.  
  636. for func in dup2 memchr sigaction strerror waitpid
  637. do
  638. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  639. echo checking for ${func}
  640. cat > conftest.c <<EOF
  641. #include "confdefs.h"
  642. #include <ctype.h>
  643. int main() { exit(0); }
  644. int t() { 
  645. /* The GNU C library defines this for functions which it implements
  646.     to always fail with ENOSYS.  Some functions are actually named
  647.     something starting with __ and the normal name is an alias.  */
  648. #if defined (__stub_${func}) || defined (__stub___${func})
  649. choke me
  650. #else
  651. /* Override any gcc2 internal prototype to avoid an error.  */
  652. extern char ${func}(); ${func}();
  653. #endif
  654.  }
  655. EOF
  656. if eval $compile; then
  657.   {
  658. test -n "$verbose" && \
  659. echo "    defining ${trfunc}"
  660. echo "#define" ${trfunc} 1 >> confdefs.h
  661. DEFS="$DEFS -D${trfunc}=1"
  662. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  663. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  664. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  665. "
  666. }
  667.  
  668. fi
  669. rm -f conftest*
  670. done
  671.  
  672. for hdr in fcntl.h limits.h stdlib.h string.h sys/wait.h time.h
  673. do
  674. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  675. echo checking for ${hdr}
  676. cat > conftest.c <<EOF
  677. #include "confdefs.h"
  678. #include <${hdr}>
  679. EOF
  680. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  681. if test -z "$err"; then
  682.   
  683. {
  684. test -n "$verbose" && \
  685. echo "    defining ${trhdr}"
  686. echo "#define" ${trhdr} 1 >> confdefs.h
  687. DEFS="$DEFS -D${trhdr}=1"
  688. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  689. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  690. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  691. "
  692. }
  693.  
  694. fi
  695. rm -f conftest*
  696. done
  697.  
  698. echo checking for vfork.h
  699. cat > conftest.c <<EOF
  700. #include "confdefs.h"
  701. #include <vfork.h>
  702. EOF
  703. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  704. if test -z "$err"; then
  705.   
  706. {
  707. test -n "$verbose" && \
  708. echo "    defining HAVE_VFORK_H"
  709. echo "#define" HAVE_VFORK_H 1 >> confdefs.h
  710. DEFS="$DEFS -DHAVE_VFORK_H=1"
  711. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD}
  712. \${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD}
  713. \${SEDeA}HAVE_VFORK_H\${SEDeB}HAVE_VFORK_H\${SEDeC}1\${SEDeD}
  714. "
  715. }
  716.  
  717. fi
  718. rm -f conftest*
  719.  
  720. echo checking for working vfork
  721. echo checking for return type of signal handlers
  722. cat > conftest.c <<EOF
  723. #include "confdefs.h"
  724. #include <sys/types.h>
  725. #include <signal.h>
  726. #ifdef signal
  727. #undef signal
  728. #endif
  729. extern void (*signal ()) ();
  730. int main() { exit(0); }
  731. int t() { int i; }
  732. EOF
  733. if eval $compile; then
  734.   
  735. {
  736. test -n "$verbose" && \
  737. echo "    defining" RETSIGTYPE to be void
  738. echo "#define" RETSIGTYPE void >> confdefs.h
  739. DEFS="$DEFS -DRETSIGTYPE=void"
  740. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  741. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  742. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  743. "
  744. }
  745.  
  746. else
  747.   
  748. {
  749. test -n "$verbose" && \
  750. echo "    defining" RETSIGTYPE to be int
  751. echo "#define" RETSIGTYPE int >> confdefs.h
  752. DEFS="$DEFS -DRETSIGTYPE=int"
  753. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  754. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  755. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  756. "
  757. }
  758.  
  759. fi
  760. rm -f conftest*
  761.  
  762.  
  763.  
  764. cat > conftest.c <<EOF
  765. #include "confdefs.h"
  766. /* Thanks to Paul Eggert for this test.  */
  767. #include <stdio.h>
  768. #include <sys/types.h>
  769. #include <sys/stat.h>
  770. #include <signal.h>
  771. #ifdef HAVE_UNISTD_H
  772. #include <unistd.h>
  773. #endif
  774. #ifdef HAVE_VFORK_H
  775. #include <vfork.h>
  776. #endif
  777. static int signalled;
  778. static RETSIGTYPE catch (s) int s; { signalled = 1; }
  779. main() {
  780.   pid_t parent = getpid ();
  781.   pid_t child;
  782.  
  783.   signal (SIGINT, catch);
  784.  
  785.   child = vfork ();
  786.  
  787.   if (child == 0) {
  788.     /* On sparc systems, changes by the child to local and incoming
  789.        argument registers are propagated back to the parent.
  790.        The compiler is told about this with #include <vfork.h>,
  791.        but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  792.        Test for this by using lots of local variables, at least
  793.        as many local variables as main has allocated so far
  794.        including compiler temporaries.  4 locals are enough for
  795.        gcc 1.40.3 on a sparc, but we use 8 to be safe.
  796.        A buggy compiler should reuse the register of parent
  797.        for one of the local variables, since it will think that
  798.        parent can't possibly be used any more in this routine.
  799.        Assigning to the local variable will thus munge parent
  800.        in the parent process.  */
  801.     pid_t
  802.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  803.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  804.     /* Convince the compiler that p..p7 are live; otherwise, it might
  805.        use the same hardware register for all 8 local variables.  */
  806.     if (p != p1 || p != p2 || p != p3 || p != p4
  807.     || p != p5 || p != p6 || p != p7)
  808.       _exit(1);
  809.  
  810.     /* On some systems (e.g. SunOS 5.2), if the parent is catching
  811.        a signal, the child ignores the signal before execing,
  812.        and the parent later receives that signal, the parent dumps core.
  813.        Test for this by ignoring SIGINT in the child.  */
  814.     signal (SIGINT, SIG_IGN);
  815.  
  816.     /* On some systems (e.g. IRIX 3.3),
  817.        vfork doesn't separate parent from child file descriptors.
  818.        If the child closes a descriptor before it execs or exits,
  819.        this munges the parent's descriptor as well.
  820.        Test for this by closing stdout in the child.  */
  821.     _exit(close(fileno(stdout)) != 0);
  822.   } else {
  823.     int status;
  824.     struct stat st;
  825.  
  826.     while (wait(&status) != child)
  827.       ;
  828.     exit(
  829.      /* Was there some problem with vforking?  */
  830.      child < 0
  831.  
  832.      /* Did the child fail?  (This shouldn't happen.)  */
  833.      || status
  834.  
  835.      /* Did the vfork/compiler bug occur?  */
  836.      || parent != getpid()
  837.  
  838.      /* Did the signal handling bug occur?  */
  839.      || kill(parent, SIGINT) != 0
  840.      || signalled != 1
  841.  
  842.      /* Did the file descriptor bug occur?  */
  843.      || fstat(fileno(stdout), &st) != 0
  844.      );
  845.   }
  846. }
  847. EOF
  848. eval $compile
  849. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  850.   :
  851. else
  852.   
  853. {
  854. test -n "$verbose" && \
  855. echo "    defining" vfork to be fork
  856. echo "#define" vfork fork >> confdefs.h
  857. DEFS="$DEFS -Dvfork=fork"
  858. SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD}
  859. \${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD}
  860. \${SEDeA}vfork\${SEDeB}vfork\${SEDeC}fork\${SEDeD}
  861. "
  862. }
  863.  
  864. fi
  865. rm -f conftest*
  866.  
  867. echo checking for vprintf
  868. cat > conftest.c <<EOF
  869. #include "confdefs.h"
  870.  
  871. int main() { exit(0); }
  872. int t() { vprintf(); }
  873. EOF
  874. if eval $compile; then
  875.   
  876. {
  877. test -n "$verbose" && \
  878. echo "    defining HAVE_VPRINTF"
  879. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  880. DEFS="$DEFS -DHAVE_VPRINTF=1"
  881. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  882. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  883. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  884. "
  885. }
  886.  
  887. else
  888.   vprintf_missing=1
  889. fi
  890. rm -f conftest*
  891.  
  892. if test -n "$vprintf_missing"; then
  893. echo checking for _doprnt
  894. cat > conftest.c <<EOF
  895. #include "confdefs.h"
  896.  
  897. int main() { exit(0); }
  898. int t() { _doprnt(); }
  899. EOF
  900. if eval $compile; then
  901.   
  902. {
  903. test -n "$verbose" && \
  904. echo "    defining HAVE_DOPRNT"
  905. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  906. DEFS="$DEFS -DHAVE_DOPRNT=1"
  907. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  908. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  909. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  910. "
  911. }
  912.  
  913. fi
  914. rm -f conftest*
  915.  
  916. fi
  917.  
  918. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  919. # for constant arguments.  Useless!
  920. echo checking for working alloca.h
  921. cat > conftest.c <<EOF
  922. #include "confdefs.h"
  923. #include <alloca.h>
  924. int main() { exit(0); }
  925. int t() { char *p = alloca(2 * sizeof(int)); }
  926. EOF
  927. if eval $compile; then
  928.   
  929. {
  930. test -n "$verbose" && \
  931. echo "    defining HAVE_ALLOCA_H"
  932. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  933. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  934. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  935. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  936. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  937. "
  938. }
  939.  
  940. fi
  941. rm -f conftest*
  942.  
  943. decl="#ifdef __GNUC__
  944. #define alloca __builtin_alloca
  945. #else
  946. #if HAVE_ALLOCA_H
  947. #include <alloca.h>
  948. #else
  949. #ifdef _AIX
  950.  #pragma alloca
  951. #else
  952. char *alloca ();
  953. #endif
  954. #endif
  955. #endif
  956. "
  957. echo checking for alloca
  958. cat > conftest.c <<EOF
  959. #include "confdefs.h"
  960. $decl
  961. int main() { exit(0); }
  962. int t() { char *p = (char *) alloca(1); }
  963. EOF
  964. if eval $compile; then
  965.   :
  966. else
  967.   alloca_missing=1
  968. cat > conftest.c <<EOF
  969. #include "confdefs.h"
  970.  
  971. #if defined(CRAY) && ! defined(CRAY2)
  972. winnitude
  973. #else
  974. lossage
  975. #endif
  976.  
  977. EOF
  978. eval "$CPP conftest.c > conftest.out 2>&1"
  979. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  980.   echo checking for _getb67
  981. cat > conftest.c <<EOF
  982. #include "confdefs.h"
  983. #include <ctype.h>
  984. int main() { exit(0); }
  985. int t() { 
  986. /* The GNU C library defines this for functions which it implements
  987.     to always fail with ENOSYS.  Some functions are actually named
  988.     something starting with __ and the normal name is an alias.  */
  989. #if defined (__stub__getb67) || defined (__stub____getb67)
  990. choke me
  991. #else
  992. /* Override any gcc2 internal prototype to avoid an error.  */
  993. extern char _getb67(); _getb67();
  994. #endif
  995.  }
  996. EOF
  997. if eval $compile; then
  998.   {
  999. test -n "$verbose" && \
  1000. echo "    defining" CRAY_STACKSEG_END to be _getb67
  1001. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  1002. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1003. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1004. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1005. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1006. "
  1007. }
  1008.  
  1009. else
  1010.   echo checking for GETB67
  1011. cat > conftest.c <<EOF
  1012. #include "confdefs.h"
  1013. #include <ctype.h>
  1014. int main() { exit(0); }
  1015. int t() { 
  1016. /* The GNU C library defines this for functions which it implements
  1017.     to always fail with ENOSYS.  Some functions are actually named
  1018.     something starting with __ and the normal name is an alias.  */
  1019. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1020. choke me
  1021. #else
  1022. /* Override any gcc2 internal prototype to avoid an error.  */
  1023. extern char GETB67(); GETB67();
  1024. #endif
  1025.  }
  1026. EOF
  1027. if eval $compile; then
  1028.   {
  1029. test -n "$verbose" && \
  1030. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1031. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1032. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1033. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1034. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1035. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1036. "
  1037. }
  1038.  
  1039. else
  1040.   echo checking for getb67
  1041. cat > conftest.c <<EOF
  1042. #include "confdefs.h"
  1043. #include <ctype.h>
  1044. int main() { exit(0); }
  1045. int t() { 
  1046. /* The GNU C library defines this for functions which it implements
  1047.     to always fail with ENOSYS.  Some functions are actually named
  1048.     something starting with __ and the normal name is an alias.  */
  1049. #if defined (__stub_getb67) || defined (__stub___getb67)
  1050. choke me
  1051. #else
  1052. /* Override any gcc2 internal prototype to avoid an error.  */
  1053. extern char getb67(); getb67();
  1054. #endif
  1055.  }
  1056. EOF
  1057. if eval $compile; then
  1058.   {
  1059. test -n "$verbose" && \
  1060. echo "    defining" CRAY_STACKSEG_END to be getb67
  1061. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1062. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1063. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1064. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1065. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1066. "
  1067. }
  1068.  
  1069. fi
  1070. rm -f conftest*
  1071.  
  1072. fi
  1073. rm -f conftest*
  1074.  
  1075. fi
  1076. rm -f conftest*
  1077.  
  1078. fi
  1079. rm -f conftest*
  1080.  
  1081.  
  1082. fi
  1083. rm -f conftest*
  1084.  
  1085. if test -n "$alloca_missing"; then
  1086.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1087.   # that cause trouble.  Some versions do not even contain alloca or
  1088.   # contain a buggy version.  If you still want to use their alloca,
  1089.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1090.   ALLOCA=alloca.o
  1091.   
  1092. {
  1093. test -n "$verbose" && \
  1094. echo "    defining C_ALLOCA"
  1095. echo "#define" C_ALLOCA 1 >> confdefs.h
  1096. DEFS="$DEFS -DC_ALLOCA=1"
  1097. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1098. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1099. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1100. "
  1101. }
  1102.  
  1103.  
  1104.   echo 'checking stack direction for C alloca'
  1105.   echo checking whether cross-compiling
  1106. # If we cannot run a trivial program, we must be cross compiling.
  1107. cat > conftest.c <<EOF
  1108. #include "confdefs.h"
  1109. main(){exit(0);}
  1110. EOF
  1111. eval $compile
  1112. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1113.   :
  1114. else
  1115.   cross_compiling=1
  1116. fi
  1117. rm -f conftest*
  1118.  
  1119. if test -n "$cross_compiling"
  1120. then
  1121.   
  1122. {
  1123. test -n "$verbose" && \
  1124. echo "    defining" STACK_DIRECTION to be 0
  1125. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1126. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1127. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1128. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1129. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1130. "
  1131. }
  1132.  
  1133. else
  1134. cat > conftest.c <<EOF
  1135. #include "confdefs.h"
  1136. find_stack_direction ()
  1137. {
  1138.   static char *addr = 0;
  1139.   auto char dummy;
  1140.   if (addr == 0)
  1141.     {
  1142.       addr = &dummy;
  1143.       return find_stack_direction ();
  1144.     }
  1145.   else
  1146.     return (&dummy > addr) ? 1 : -1;
  1147. }
  1148. main ()
  1149. {
  1150.   exit (find_stack_direction() < 0);
  1151. }
  1152. EOF
  1153. eval $compile
  1154. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1155.   
  1156. {
  1157. test -n "$verbose" && \
  1158. echo "    defining" STACK_DIRECTION to be 1
  1159. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1160. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1161. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1162. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1163. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1164. "
  1165. }
  1166.  
  1167. else
  1168.   
  1169. {
  1170. test -n "$verbose" && \
  1171. echo "    defining" STACK_DIRECTION to be -1
  1172. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1173. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1174. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1175. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1176. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1177. "
  1178. }
  1179.  
  1180. fi
  1181. fi
  1182. rm -f conftest*
  1183. fi
  1184.  
  1185. echo checking for st_blksize in struct stat
  1186. cat > conftest.c <<EOF
  1187. #include "confdefs.h"
  1188. #include <sys/types.h>
  1189. #include <sys/stat.h>
  1190. int main() { exit(0); }
  1191. int t() { struct stat s; s.st_blksize; }
  1192. EOF
  1193. if eval $compile; then
  1194.   
  1195. {
  1196. test -n "$verbose" && \
  1197. echo "    defining HAVE_ST_BLKSIZE"
  1198. echo "#define" HAVE_ST_BLKSIZE 1 >> confdefs.h
  1199. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  1200. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLKSIZE\${SEDdB}HAVE_ST_BLKSIZE\${SEDdC}1\${SEDdD}
  1201. \${SEDuA}HAVE_ST_BLKSIZE\${SEDuB}HAVE_ST_BLKSIZE\${SEDuC}1\${SEDuD}
  1202. \${SEDeA}HAVE_ST_BLKSIZE\${SEDeB}HAVE_ST_BLKSIZE\${SEDeC}1\${SEDeD}
  1203. "
  1204. }
  1205.  
  1206. fi
  1207. rm -f conftest*
  1208.  
  1209. echo checking for broken stat file mode macros
  1210. cat > conftest.c <<EOF
  1211. #include "confdefs.h"
  1212. #include <sys/types.h>
  1213. #include <sys/stat.h>
  1214. #ifdef S_ISBLK
  1215. #if S_ISBLK (S_IFDIR)
  1216. You lose.
  1217. #endif
  1218. #ifdef S_IFCHR
  1219. #if S_ISBLK (S_IFCHR)
  1220. You lose.
  1221. #endif
  1222. #endif /* S_IFCHR */
  1223. #endif /* S_ISBLK */
  1224. #ifdef S_ISLNK
  1225. #if S_ISLNK (S_IFREG)
  1226. You lose.
  1227. #endif
  1228. #endif /* S_ISLNK */
  1229. #ifdef S_ISSOCK
  1230. #if S_ISSOCK (S_IFREG)
  1231. You lose.
  1232. #endif
  1233. #endif /* S_ISSOCK */
  1234.  
  1235. EOF
  1236. eval "$CPP conftest.c > conftest.out 2>&1"
  1237. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  1238.   
  1239. {
  1240. test -n "$verbose" && \
  1241. echo "    defining STAT_MACROS_BROKEN"
  1242. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  1243. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  1244. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  1245. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  1246. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  1247. "
  1248. }
  1249.  
  1250. fi
  1251. rm -f conftest*
  1252.  
  1253. echo checking for Xenix
  1254. cat > conftest.c <<EOF
  1255. #include "confdefs.h"
  1256. #if defined(M_XENIX) && !defined(M_UNIX)
  1257.   yes
  1258. #endif
  1259.  
  1260. EOF
  1261. eval "$CPP conftest.c > conftest.out 2>&1"
  1262. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1263.   XENIX=1
  1264. fi
  1265. rm -f conftest*
  1266.  
  1267. if test -n "$XENIX"; then
  1268.   LIBS="$LIBS -lx"
  1269.   case "$DEFS" in
  1270.   *SYSNDIR*) ;;
  1271.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1272.   esac
  1273. fi
  1274.  
  1275. # Set default prefixes.
  1276. if test -n "$prefix"; then
  1277.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1278.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1279. fi
  1280. if test -n "$exec_prefix"; then
  1281.   prsub="$prsub
  1282. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  1283. fi
  1284. # Quote sed substitution magic chars in DEFS.
  1285. cat >conftest.def <<EOF
  1286. $DEFS
  1287. EOF
  1288. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1289. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1290. rm -f conftest.def
  1291. # Substitute for predefined variables.
  1292.  
  1293. trap 'rm -f config.status; exit 1' 1 3 15
  1294. echo creating config.status
  1295. rm -f config.status
  1296. cat > config.status <<EOF
  1297. #!/bin/sh
  1298. # Generated automatically by configure.
  1299. # Run this file to recreate the current configuration.
  1300. # This directory was configured as follows,
  1301. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1302. #
  1303. # $0 $configure_args
  1304.  
  1305. for arg
  1306. do
  1307.   case "\$arg" in
  1308.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1309.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1310.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1311.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1312.   esac
  1313. done
  1314.  
  1315. trap 'rm -fr Makefile config.h conftest*; exit 1' 1 3 15
  1316. CC='$CC'
  1317. CPP='$CPP'
  1318. INSTALL='$INSTALL'
  1319. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1320. INSTALL_DATA='$INSTALL_DATA'
  1321. ALLOCA='$ALLOCA'
  1322. LIBS='$LIBS'
  1323. srcdir='$srcdir'
  1324. prefix='$prefix'
  1325. exec_prefix='$exec_prefix'
  1326. prsub='$prsub'
  1327. EOF
  1328. cat >> config.status <<\EOF
  1329.  
  1330. top_srcdir=$srcdir
  1331.  
  1332. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  1333. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1334.   srcdir=$top_srcdir
  1335.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1336.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1337.   if test "$dir" != "$file"; then
  1338.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1339.     test ! -d $dir && mkdir $dir
  1340.   fi
  1341.   echo creating $file
  1342.   rm -f $file
  1343.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1344.   sed -e "
  1345. $prsub
  1346. s%@CC@%$CC%g
  1347. s%@CPP@%$CPP%g
  1348. s%@INSTALL@%$INSTALL%g
  1349. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1350. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1351. s%@ALLOCA@%$ALLOCA%g
  1352. s%@LIBS@%$LIBS%g
  1353. s%@srcdir@%$srcdir%g
  1354. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1355. fi; done
  1356.  
  1357. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  1358. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1359. echo creating $file
  1360.  
  1361. # These sed commands are put into SEDDEFS when defining a macro.
  1362. # They are broken into pieces to make the sed script easier to manage.
  1363. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1364. # is the cpp macro being defined and VALUE is the value it is being given.
  1365. # Each defining turns into a single global substitution command.
  1366. #
  1367. # SEDd sets the value in "#define NAME VALUE" lines.
  1368. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1369. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1370. SEDdC='\3'
  1371. SEDdD='@g'
  1372. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1373. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1374. SEDuB='\([     ]\)@\1#\2define\3'
  1375. SEDuC=' '
  1376. SEDuD='\4@g'
  1377. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1378. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1379. SEDeB='$@\1#\2define\3'
  1380. SEDeC=' '
  1381. SEDeD='@g'
  1382. rm -f conftest.sed
  1383. EOF
  1384. # Turn off quoting long enough to insert the sed commands.
  1385. rm -f conftest.sh
  1386. cat > conftest.sh <<EOF
  1387. $SEDDEFS
  1388. EOF
  1389.  
  1390. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1391. # on the size of here documents.
  1392.  
  1393. # Maximum number of lines to put in a single here document.
  1394. maxshlines=9
  1395.  
  1396. while :
  1397. do
  1398.   # wc gives bogus results for an empty file on some systems.
  1399.   lines=`grep -c . conftest.sh`
  1400.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1401.   rm -f conftest.s1 conftest.s2
  1402.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1403.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1404.   # Write a limited-size here document to append to conftest.sed.
  1405.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1406.   cat conftest.s1 >> config.status
  1407.   echo 'CONFEOF' >> config.status
  1408.   rm -f conftest.s1 conftest.sh
  1409.   mv conftest.s2 conftest.sh
  1410. done
  1411. rm -f conftest.sh
  1412.  
  1413. # Now back to your regularly scheduled config.status.
  1414. cat >> config.status <<\EOF
  1415. # This sed command replaces #undef's with comments.  This is necessary, for
  1416. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1417. # on some systems where configure will not decide to define it in
  1418. # config.h.
  1419. cat >> conftest.sed <<\CONFEOF
  1420. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1421. CONFEOF
  1422. rm -f conftest.h
  1423. # Break up the sed commands because old seds have small limits.
  1424. maxsedlines=20
  1425. cp $top_srcdir/$file.in conftest.h1
  1426. while :
  1427. do
  1428.   lines=`grep -c . conftest.sed`
  1429.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1430.   rm -f conftest.s1 conftest.s2 conftest.h2
  1431.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1432.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1433.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1434.   rm -f conftest.s1 conftest.h1 conftest.sed
  1435.   mv conftest.h2 conftest.h1
  1436.   mv conftest.s2 conftest.sed
  1437. done
  1438. rm -f conftest.sed conftest.h
  1439. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1440. cat conftest.h1 >> conftest.h
  1441. rm -f conftest.h1
  1442. if cmp -s $file conftest.h 2>/dev/null; then
  1443.   # The file exists and we would not be changing it.
  1444.   echo "$file is unchanged"
  1445.   rm -f conftest.h
  1446. else
  1447.   rm -f $file
  1448.   mv conftest.h $file
  1449. fi
  1450. fi; done
  1451.  
  1452.  
  1453. exit 0
  1454. EOF
  1455. chmod +x config.status
  1456. ${CONFIG_SHELL-/bin/sh} config.status
  1457.  
  1458.